# -*- coding: utf-8 -*-
from odoo import models, api, fields, tools
from odoo.exceptions import UserError
import re


class crop_promotion_item(models.Model):

    _name = "datcent.crop_promotion_item"
    _description = "品种推广清单"
    _table = "datcent_crop_promotion_item"
    _order = "sequence"

    sequence = fields.Integer(string="排序",translate = 0)
    main_id = fields.Many2one(string="主单据号",comodel_name = 'datcent.crop_promotion',ondelete = 'cascade',translate = 0)
    company_id = fields.Many2one(string="所属公司",comodel_name = 'res.company',default = lambda self:self.env.company,required = 1,translate = 0)
    name = fields.Char(string="清单名称",translate = 0)
    year = fields.Date(string="推广年份",translate = 0)
    region_id = fields.Many2one(string="推广地区",comodel_name = 'setcent.region',translate = 0)
    quantity = fields.Float(string="推广面积",translate = 0)
    uom_id = fields.Many2one(string="计量单位",comodel_name = 'uom.uom',translate = 0)
    memo = fields.Text(string="备注说明",translate = 0)
